package com.example.demo4.controller;


import com.example.demo4.domain.Student;
import com.example.demo4.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Controller
public class StudentController {
    @Autowired
    StudentService studentService;
    @RequestMapping("/student/list")
    public String list(Model model) {
        List<Student> students =studentService.findAll();
        System.out.println(students);
        model.addAttribute("data",students);
        // templates
        return "student/list";
    }
<<<<<<< HEAD

=======
>>>>>>> bcb091a17987267f0d65e4154f997543fe5bec34
}
